/**
 * Created by Administrator on 2017/4/18.
 */
angular.module('service.order', [
    "ngResource",
])
    //获取商店列表
    .service('OrderService', ['$resource','HomeService', function ($resource,HomeService) {
        var order = $resource(mallorder + "orders/:orderid");
        this.getOrder = function(success,error){
            var id = HomeService.getid('verificationid');
            var Order = order.get({orderid:id},success,error);
            Order.$promise.then(function(list){
                console.log(list);
                list.status = 2;
                order.save({orderid:list.orderid},list,function(data){
                        swal("成功", "核销成功！", "success");
                    },function(error){

                    });
            })
        };
        /*根据verificationid 获取订单详情*/
        this.getByid = function(id,success,error){
            var goodsList = $resource(mallorder + 'orders/byorderid/:orderid');
            return goodsList.get({orderid:id},success,error);
        };
    }])



